package com.netty.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author zl
 * @version 1.0
 * @date 2021/9/13 17:35
 */

public class MessageEntity {
    @ApiModel("一对一聊天")
    @Data
    public static class P2PEntity{
        @NotNull(message = "type 不能为空")
        @ApiModelProperty("消息类型")
        private String  type;
        @NotNull(message = "sessionId 不能为空")
        @ApiModelProperty("sessionid 消息唯一编码")
        private String sessionId;
        @NotNull(message = "msg 消息内容不能为空")
        @ApiModelProperty("msg 消息内容")
        private String msg;
        @NotNull(message = "接收者唯一编码不能为空")
        @ApiModelProperty("接收者唯一编码")
        private Long toId;
        @NotNull(message = "发送者唯一编码不能为空")
        @ApiModelProperty("发送者唯一编码")
        private Long fromId;

    }
    @ApiModel("一对多聊天")
    @Data
    public static class P2MEntity{
        @NotNull(message = "type 不能为空")
        @ApiModelProperty("消息类型")
        private String  type;
        @NotNull(message = "sessionId 不能为空")
        @ApiModelProperty("sessionid 消息唯一编码")
        private String sessionId;
        @NotNull(message = "msg 消息内容不能为空")
        @ApiModelProperty("msg 消息内容")
        private String msg;
        @NotNull(message = "groupId 不能为空")
        @ApiModelProperty("group id")
        private String groupId;
        @NotNull(message = "发送者唯一编码不能为空")
        @ApiModelProperty("发送者唯一编码")
        private Long fromId;

    }

    @ApiModel("发送给所有人")
    @Data
    public static class P2ALLEntity{
        /**
         * 消息发送者账号
         */
        @NotNull(message = "fromUserId 不能为空")
        @ApiModelProperty("消息发送者账号")
        private Integer fromUserId;
        @NotNull(message = "type 不能为空")
        @ApiModelProperty("消息类型")
        private String  type;
        @NotNull(message = "msg 消息内容不能为空")
        @ApiModelProperty("msg 消息内容")
        private String msg;

    }

}
